package com.colabo.j2ee.web.oaf.menu;

import com.colabo.j2ee.web.core.cache.AbstractCacheBean;
import com.colabo.j2ee.web.oaf.menu.action.MenuAction;

public class CachedMenuBean extends AbstractCacheBean {

	public static final String GROUP = "Menu";
	public static final String ALLMENUS = "allMenus";
	
	@Override
	public void init() {
		cache.flushGroup(GROUP);
		MenuAction action = new MenuAction();
		try {
			String cachedContent = action.getAllMenusFromPersistence();
			cache.putGroup(ALLMENUS, cachedContent, GROUP);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
